/**
* Class Name: iFulfillRoadMapCntrlrTest
* Author: Accenture
* Date: 13-July-2011
* Requirement/Project Name: iFulfill
* Requirement/Project Description: Test class for iFulfillRoadMapCntrlr
**/


@istest
private class iFulfillRoadMapCntrlrTest 
{
   /**
   *    Test Method.
   */
    public  static testmethod void testgetstages()
    {
        list<Stage_Definition__c> stageDef = new list<Stage_Definition__c>();
        Workflow_Definition__c testWD = new Workflow_Definition__c();
         list<Workflow_Stage__c> preDeFuncList = new list<Workflow_Stage__c>();
         
        testWD.Workflow_Name__c = 'Testing the Defination Creation';
        testWD.Workflow_Description__c = 'This is the workflow defination description to ensure test covereage';
        testWD.Version__c = 1.0;
        testWD.Status__c = 'Active';
        insert testWD;
        Stage_Definition__c newPDF1 = new Stage_Definition__c(name = 'Function Definition 1 for test',Stage_Description__c ='Test Function 1',Sequence__c = 70, Status__c ='Active' );
        Stage_Definition__c newPDF2 = new Stage_Definition__c(name = 'Function Definition 2 for test',Stage_Description__c ='Test Function 2',Sequence__c = 71, Status__c ='Active' );
     
      Workflow_Stage__c newF1 = new Workflow_Stage__c (Stage__c =newPDF1.id, Sequence__c = 1.0, Workflow_Code__c =testWD.id);
       Workflow_Stage__c newF2 = new Workflow_Stage__c (Stage__c =newPDF2.id, Sequence__c = 1.0, Workflow_Code__c =testWD.id);

         insert   newF1;
           insert   newF2;
         
         insert newPDF1;
         insert newPDF2;
          
         Fullfilment_Item__c FI = new Fullfilment_Item__c(   Main_Listing_Phone_Number__c = '100',Listed_Name__c ='XYZ',
         Heading_Name__c ='Heading name',Item_Id__c = 'Item id' ,Product_Code__c ='p1',UDAC__c ='Udac1',
         Region__c = 'region1',Transaction_Type__c ='New',
          Workflow_Code__c =testWD.Id);

        PageReference pg = Page.iFulfillViewRoadMap;
        Test.setCurrentPage(pg); 
        ApexPages.StandardController sc = new ApexPages.StandardController(FI);
        iFulfillRoadMapCntrlr roadMap = new iFulfillRoadMapCntrlr(sc );
        
        roadMap.getStages();
    }
}